IF exists(SELECT * FROM dbo.sysobjects WHERE name='maakRoosterVariant' AND xtype='P') 
BEGIN
	DROP PROCEDURE maakRoosterVariant
END
GO

create  procedure maakRoosterVariant(
@naamcode char(4),
@variant char(1)) 
as
if (len(@variant) = 1)
insert into rooster(deLeraar,hetVak,deKlas,deDag,hetUur,hetLokaal,variant)
select deLeraar,hetVak,deKlas,deDag,hetUur,hetLokaal,@variant
from rooster 
where deLeraar = @naamcode
and variant is null